package factoryGame;

import game.constants.ImagesSingleton;
import game.constants.ReferenceObject;
import objects.ImageObject;

public class ImageObjectFactory {
	
	public static ImageObject createImageObject(int type){
		ImageObject img =new ImageObject();
		switch (type){
		case ReferenceObject.OBJECT_REFERENCE_PLAYER:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_PLAYER]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_PLAYER]);
			System.out.println("cargo player");
		break;
		case ReferenceObject.OBJECT_REFERENCE_POTION:
			
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_POTION]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_POTION]);
			System.out.println("cargo pocion");
			System.out.println(img.getCollisionShape().getHeight());
		break;
		case ReferenceObject.OBJECT_REFERENCE_MONSTER_1:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_MONSTER_1]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_MONSTER_1]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_BONES:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_BONES]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_BONES]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_FLOWER:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_FLOWER]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_FLOWER]);
		break;	
		case ReferenceObject.OBJECT_REFERENCE_AXE:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_AXE]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_AXE]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_TREE:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TREE]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE]);
			System.out.println("TREEEEEEEE :  "+ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE].getWidth());
			System.out.println("TREEEEEEEE :  "+ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE].getHeight());
		break;
		case ReferenceObject.OBJECT_REFERENCE_TRUNK:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TRUNK]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRUNK]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_DOG:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_DOG]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_DOG]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_TRASNPORT:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TRASNPORT]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRASNPORT]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_TRASNPORT1:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TRASNPORT1]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRASNPORT1]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_TREE1:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TREE1]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE1]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_HOUSE1:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_HOUSE1]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_HOUSE1]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_STONE:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_STONE]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_STONE]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_TABLE:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_TABLE]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_TABLE]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_SWORD:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_SWORD]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_SWORD]);
		break;
		case ReferenceObject.OBJECT_REFERENCE_RAT:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_RAT]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_RAT]);
		break;
		default:
			img.setImageToShow(ImagesSingleton.images[ReferenceObject.OBJECT_REFERENCE_POTION]);
			img.setCollisionShape(ImagesSingleton.imagesCollision[ReferenceObject.OBJECT_REFERENCE_POTION]);
			System.out.println("NO se que cargue, Cuidado con las collisiones-> ImageObjectFactory "+type);
		break;
		
		}
		
		return img;
	}
	

}
